// 引入静态路由
import { constantRoutes } from '@/router'

export default {
  // 开启命名空间
  namespaced: true,
  state: {
    menusList: []
  },
  mutations: {
    // 动态路由val  合并
    setMenus(state, val) {
      state.menusList = [...constantRoutes, ...val]
      // 将404放在最后
      state.menusList.push({ path: '*', redirect: '/404', hidden: true })
    }
  }
}
